ISSDK  1.8
IoT Sensing Software Development Kit
gpio_driver.h
Go to the documentation of this file.
1 /*
2  * Copyright 2022 NXP
3  * All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 /**
9  * @file gpio_driver.h
10  * @brief The gpio_driver.h file containes the Generic Irq implmentation for the i.MXRT1180 gpio.
11 */
12 
13 #ifndef __DRIVER_GPIO_H__
14 #define __DRIVER_GPIO_H__
15 
16 #if 1
17 #include "Driver_Common.h"
18 #include "Driver_GPIO.h"
19 #include "fsl_common.h"
20 #include "fsl_rgpio.h"
21 
22 #define PIN_SET 1U
23 #define PIN_CLR 0U
24 
25 /**
26 \brief GPIO PORT NAMES.
27 */
28 typedef enum port_number
29 {
30  GPIO1_NUM = 1,
31  GPIO2_NUM = 2,
32  GPIO3_NUM = 3,
33  GPIO4_NUM = 4,
34  GPIO5_NUM = 5,
37 
38 /*!
39  * @brief The GPIO Pin Configuration i.MX SDK.
40  */
41 typedef struct gpioConfigiMXSDK
42 {
43  rgpio_pin_config_t pinConfig; /*!< General pin charactertics.*/
44  rgpio_interrupt_config_t interruptMode; /*!< Interrupt mode for a pin.*/
46 
47 /*!
48  * @brief The GPIO pin handle for i.MX SDK.
49  */
50 typedef struct gpioHandleiMXSDK
51 {
52  RGPIO_Type *base; /*!< Base address of the GPIO Port.*/
53  uint32_t pinNumber; /*!< pin number start from 0 -31.*/
54  uint32_t mask; /*!< mask value for a pin.*/
55  IRQn_Type irq; /*!< IRQ Number for the port.*/
56  port_number_t portNumber; /*!< Port Number for the port.*/
57  uint8_t pinStatus; /*!< pin status.*/
59 
60 /*!
61  * @brief The gpio isr object.
62  */
63 typedef struct gpioIsrObj
64 {
65  void *pUserData; /*!< Pointer to a UserData.*/
66  gpio_isr_handler_t isrHandle; /*!< pointer to isrHandle.*/
67 } gpioIsrObj_t;
68 
69 /*!
70  * @brief Macro to create a Gpio handle
71  */
72 #define MAKE_GPIO_HANDLE(Base, PinNumber, Irq) \
73  static gpioHandleKSDK_t PortName##PinNumber = {.base = Base, \
74  .pinNumber = PinNumber, \
75  .irq = Irq};
77 #endif
78 #endif // __DRIVER_GPIO_H__
struct gpioConfigiMXSDK gpioConfigiMXSDK_t
The GPIO Pin Configuration i.MX SDK.
The GPIO Pin Configuration i.MX SDK.
Definition: gpio_driver.h:40
rgpio_interrupt_config_t interruptMode
Definition: gpio_driver.h:44
RGPIO_Type * base
Definition: gpio_driver.h:52
The gpio isr object.
Definition: gpio_driver.h:62
void(* gpio_isr_handler_t)(void *apUserData)
Definition: Driver_GPIO.h:34
Access structure of the GPIO Driver.
Definition: Driver_GPIO.h:38
struct gpioHandleiMXSDK gpioHandleiMXSDK_t
The GPIO pin handle for i.MX SDK.
enum port_number port_number_t
GPIO PORT NAMES.
The Driver_GPIO.h file contains the definitions for GPIO Driver direction.
struct gpioIsrObj gpioIsrObj_t
The gpio isr object.
rgpio_pin_config_t pinConfig
Definition: gpio_driver.h:43
The GPIO pin handle for i.MX SDK.
Definition: gpio_driver.h:49
GENERIC_DRIVER_GPIO Driver_GPIO_KSDK
Definition: gpio_driver.c:177
port_number
GPIO PORT NAMES.
Definition: gpio_driver.h:27